﻿using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.Web.Mvc;

namespace TbShop.Web.Areas.Admin.Models
{
    /// <summary>
    /// 登录数据模型
    /// </summary>
    public class LoginViewModel
    {
        [Required]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    /// <summary>
    /// 普通用户注册数据模型
    /// </summary>
    public class NormalRegisterViewModel
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string ValidationCode { get; set; }

        /// <summary>
        /// 普通用户类型
        /// </summary>
        public string NormalMemberType { get; set; }

        /// <summary>
        /// 普通用户类型列表
        /// </summary>
        public IEnumerable<SelectListItem> NormalMemberTypeList { get; set; }

        /// <summary>
        /// 所属公司Id
        /// </summary>
        public int CompanyId { get; set; }

        /// <summary>
        /// 公司列表
        /// </summary>
        public IEnumerable<SelectListItem> CompanyList { get; set; }

        /// <summary>
        /// 地区Id
        /// </summary>
        public int AreaId { get; set; }

        /// <summary>
        /// 地区名称
        /// </summary>
        public string AreaName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [Display(Name = "密码")]
        [StringLength(100, ErrorMessage = "{0}应在{1}位-{2}位之间", MinimumLength = 6)]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// 推荐码
        /// </summary>
        public string ReferralCode { get; set; }

        /// <summary>
        /// 是否接受平台协议
        /// </summary>
        public bool AcceptAgreement { get; set; }
    }

    /// <summary>
    /// 企业用户数据模型
    /// </summary>
    public class EnterpriseRegisterViewModel
    {
        /// <summary>
        /// 企业名称
        /// </summary>
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [Required]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 手机验证码
        /// </summary>
        [Required]
        public string ValidationCode { get; set; }

        /// <summary>
        /// 企业地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 法人
        /// </summary>
        [Required]
        public string Legal { get; set; }

        /// <summary>
        /// 法人联系方式
        /// </summary>
        [Required]
        public string LegalContactNumber { get; set; }

        /// <summary>
        /// 法人身份证号
        /// </summary>
        [Required]
        public string LegalIdCardNumber { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        public string ContactPerson { get; set; }

        /// <summary>
        /// 联系人手机号码
        /// </summary>
        public string ContactNumber { get; set; }

        /// <summary>
        /// 年销售额
        /// </summary>
        public decimal SalesVolume { get; set; }

        /// <summary>
        /// 营业执照编号
        /// </summary>
        [Required]
        public string BusinessLicenseNumber { get; set; }

        /// <summary>
        /// 营业执照照片（相对路径）
        /// </summary>
        public string BusinessLicenseImage { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [Display(Name = "密码")]
        [StringLength(100, ErrorMessage = "{0}应在{1}位-{2}位之间", MinimumLength = 6)]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// 推荐码
        /// </summary>
        public string ReferralCode { get; set; }

        /// <summary>
        /// 是否接受平台协议
        /// </summary>
        public bool AcceptAgreement { get; set; }
    }

    /// <summary>
    /// 忘记密码数据模型
    /// </summary>
    public class ForgetPasswordViewModel
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Required]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 验证码
        /// </summary>
        [Required]
        public string ValidationCode { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [Display(Name = "密码")]
        [StringLength(100, ErrorMessage = "{0}应在{1}位-{2}位之间", MinimumLength = 6)]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        /// <summary>
        /// 确认密码
        /// </summary>
        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "两次输入的密码不一致")]
        public string ConfirmPassword { get; set; }
    }
}
